Declare a delegate that takes an object and a Command<ValueType> as parameters and has no return type.

Namespace:  Equis.JanusToolkit
Assembly:  Janus (in Janus.dll)

Syntax

C#
public delegate void CommandHandler(
	Object sender,
	Command<ValueType> v
)

Parameters

sender
Type: System..::..Object
v
Type: Equis.JanusToolkit..::..Command<(Of <(<'ValueType>)>)>

Remarks

An event is triggered at the time associated with a command If when a RemoteSet occurs, the current time is greater than or equal to the time of the command, the event is triggered immediately Otherwise, the command time line is polled periodically and when the time of the command arrives, an event is triggered. The method that is called when the event is triggered receives 2 parameters:
  • the object that triggered the event
  • the CommandTimeLine value that was being set

Examples

Set up a listener for the RemoteSet event
 Copy imageCopy Code
            // create a timeline
            Command[playerNumber] = new TankCommandTimeLine("command-"   clientNumber));
            // every time a new value is set in the timeline "myStream" execute the function "ProcessRemoteSet"
            Commands[playerNumber].Command  = new TankCommandTimeLine.CommandHandler(ProcessCommand);
            
Then create a function called "ProcessCommand"
 Copy imageCopy Code
            static void ProcessCommand(object sender, Command<TankCommand> v)
            {
                TankCommand currentCommand = v.Val;
                // do some stuff
            }
            

See Also